<?php
/**
 * Created by PhpStorm.
 * User: ming
 * Date: 17-8-16
 * Time: 下午3:09
 */
$serv=new swoole_server('0.0.0.0',9502,SWOOLE_PROCESS,SWOOLE_SOCK_UDP);

$serv->on('packet',function ($serv,$data,$fd){

    $serv->sendto($fd['address'],$fd['port'],"Server:$data");
    var_dump($fd);
});

$serv->start();